package com.study.zzedu.ui.classchat;

import android.content.Context;

import com.study.zzedu.base.BasePresenter;
import com.study.zzedu.base.BaseView;
import com.study.zzedu.http.OnResultListener;

public class ClassChatPresenter extends BasePresenter<ChatContract.IView>{

    private ClassChatModel cModel;
    public ClassChatPresenter(){
        this.cModel = new ClassChatModel();
    }

    public void getChatInfoList(Context context,String beforeOrAfter,String onlyTeacher,String dataTime){
        cModel.getChatInfoList(context, beforeOrAfter, onlyTeacher,dataTime,new OnResultListener() {
            @Override
            public void onSuccess(String result) {
                getView().getData(result);
            }

            @Override
            public void onError(String error) {
                getView().getData(error);
            }
        });
    }

    public void sendData(Context context,String content){
        cModel.sendData(context, content,new OnResultListener() {
            @Override
            public void onSuccess(String result) {
                getView().getSendBack(result);
            }

            @Override
            public void onError(String error) {
                getView().getSendBack(error);
            }
        });
    }
}

